import turtle
import easygui
import time
import easygui as a
import sys

pen = turtle.Pen()
kc = ['全部', '第一课', '第二课', '第三课', '第四课', '第五课']
yk = ['上', '下', '火', '山', '水']
ek = ['一', '二', '三', '四', '五']
sak = ['左', '右', '木', '水', '土']
sik = ['小', '大', '中', '爸', '妈']
wk = ['哥', '皓', '刘', '云', '冰']
jg = easygui.msgbox('欢迎使用PY识字，本程序由JackuXL制作，点击“OK”后选择课程，即可开始。', 'PY识字 By JackuXL 3.1')
if (jg == None):
    sys.exit()
else:
    for __count in range(9999):
        c = a.choicebox('请选择课程', 'PY识字 By JackuXL 3.1', kc)
        if (c == None):
            sys.exit()
        else:
            s = (a.enterbox('请输入每个字的显示时间（s）：'))
            try:
                s = int(s)
            except TypeError:
                easygui.msgbox('请输入正确的数值！', 'PY识字 By JackuXL 3.1')
                continue
            if (c == '第一课'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = yk[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text,font=('Arial',200))
                    time.sleep(s)
            elif (c == '第二课'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = ek[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
            elif (c == '第三课'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = sak[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
            elif (c == '第四课'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = sik[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
            elif (c == '第五课'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = wk[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
            elif (c == '全部'):
                b = 1
                for b in range(5):
                    pen.clear()
                    text = yk[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
                for b in range(5):
                    pen.clear()
                    text = ek[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
                for b in range(5):
                    pen.clear()
                    text = sak[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
                for b in range(5):
                    pen.clear()
                    text = sik[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
                for b in range(5):
                    pen.clear()
                    text = wk[b]
                    pen.penup()
                    pen.goto((-100), (-100))
                    pen.pendown()
                    pen.write(text, font=('Arial', 200))
                    time.sleep(s)
            else:
                pass
